<?php

function num(){
  static $n=1;
  echo $n."<br>";
  $n++;
}

num();
num();